import React from 'react'
import {
	StyleSheet,
	Image
} from 'react-native'
import {
	StackNavigator
} from 'react-navigation'

import * as publicParams from './public'

//我的入口
const MyTabs = StackNavigator({
	List: {
		screen: publicParams.MyScreen,
		navigationOptions: ({
			navigation
		}) => ({
			headerTitle: '我的',
			headerTitleStyle: {
				alignSelf: 'center',
				fontSize: 16
			}
		})
	},
	Login: {
		screen: publicParams.LoginScreen,
		navigationOptions: ({
			navigation
		}) => ({
			title: '快速登录',
			headerStyle: headerStyle,
			headerTintColor: '#fff',
			tabBarVisible: false,
			headerTitleStyle: {
				alignSelf: 'center',
				fontSize: 16
			},
			headerRight: (
				<View></View>
			)
		})
	},
	Comment: {
		screen: publicParams.CommentScreen,
		navigationOptions: ({
			navigation
		}) => ({
			title: `${navigation.state.params.name}列表页`,
			headerStyle: headerStyle,
			headerTintColor: '#fff',
			tabBarVisible: false,
			headerTitleStyle: {
				alignSelf: 'center',
				fontSize: 16,
			}
		})
	},

})
MyTabs.navigationOptions = {
	title: '我的',
	tabBarLabel: '我的',
	tabBarIcon: ({
		tintColor,
		focused
	}) => (
		<Image
    source={focused ? require('../../static/Image/bottombtn0402.png') : require('../../static/Image/bottombtn0401.png')}
    style={[styles.icon, {tintColor: tintColor}]}
      />
	),
}

const styles = StyleSheet.create({
	icon: {
		width: 26,
		height: 26,
	},
	headerStyle: {
		height: 52,
		paddingTop: 14,
		backgroundColor: '#e62e4c',
	}
});
export default MyTabs;